<section class="content">
    <div class="left-content">
        <span class="main-text">Admin area</span>
        <span class="title-text">Edit Post</span>
        <div class="desc">
            Here you can edit the chosen post.
        </div>
        <div id="validation">
            <?php 
                echo validation_errors();
            ?>
        </div>
        <?php 
            if(isset($row)) {
                echo form_open('blog/editedPost/'.$this->uri->segment(3));
                echo form_label('Post title:','', array(
                    'for' => 'title',
                    'class' => 'form_label'
                ));
                echo form_input(array(
                    'name' => 'title',
                    'id' => 'title', 
                    'value' => $row->title,
                    'class' => 'form_input' 
                ));
                echo form_label('Post content:','', array(
                    'for' => 'content',
                    'class' => 'form_label'
                ));
                echo form_textarea(array(
                    'name' => 'content',
                    'id' => 'content', 
                    'value' => $row->content,
                    'class' => 'form_textarea' 
                ));
                echo form_submit(array(
                    'class' => 'learn',
                    'value' => 'Edit post'
                ));
                echo form_close();
            }else {
                echo form_open('blog/editedPost');
                echo form_label('Post title:','', array(
                    'for' => 'title',
                    'class' => 'form_label'
                ));
                echo form_input(array(
                    'name' => 'title',
                    'id' => 'title', 
                    'class' => 'form_input' 
                ));
                echo form_label('Post content:','', array(
                    'for' => 'content',
                    'class' => 'form_label'
                ));
                echo form_textarea(array(
                    'name' => 'content',
                    'id' => 'content', 
                    'class' => 'form_textarea' 
                ));
                echo form_submit(array(
                    'class' => 'learn',
                    'value' => 'Edit post'
                ));
                echo form_close();
            }
        ?>
    </div>
    <div class="right-content">
    </div>
</section>
